﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CustomerList.aspx.cs" Inherits="Eis51.Web.Admin.NewsManager.CustomerList" %>

<%@ Register Assembly="My97" Namespace="My97" TagPrefix="cc2" %>
<%@ Register TagPrefix="cc1" Namespace="COM.ZTE.TPG.App.UI.WebForm" Assembly="COM.ZTE.TPG.App.UI.WebForm" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
    <title>ProductsList</title>
    <link href="../../css/cssCn1.css" type="text/css" rel="stylesheet">
    <link href="../../css/cssCn.css" type="text/css" rel="stylesheet">
    <script src="../../js/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">

        function SelectAll(strGridId) {

            var objCK = document.getElementsByTagName("input");
            var loop;
            var index = 0;
            var objArray = new Array();

            for (loop = 1; loop < objCK.length; loop++) {
                if (objCK[loop].type == "checkbox") {
                    if (objCK[loop].id.indexOf(strGridId) != -1) {
                        objArray[index] = objCK[loop];
                        index++;
                    }
                }
            }
            for (loop = 1; loop < objArray.length; loop++) {
                if (!objArray[loop].disabled) {
                    objArray[loop].click();
                    objArray[loop].checked = objArray[0].checked;
                }
            }
        }
        function CheckSelected(strGridId, isdel) {
            var taskIds;
            var check = false;
            var objCK = document.getElementsByTagName("input");
            var loop;
            var index = 0;
            var objArray = new Array();
            for (loop = 1; loop < objCK.length; loop++) {
                if (objCK[loop].type == "checkbox") {
                    if (objCK[loop].id.indexOf(strGridId) != -1) {
                        objArray[index] = objCK[loop];
                        index++;
                    }
                }
            }

            for (loop = 1; loop < objArray.length; loop++) {
                if (objArray[loop].checked) {

                    check = true;
                }
            }



            if (!check) {
                alert('请至少选择一个客户案例进行操作！');
                return false;
            }
            if (isdel == 1) {
                return confirm("确认要删除你所选择的数据吗？");
            }


        }
    
    
    </script>
    
</head>
<body ms_positioning="GridLayout">
    <form id="Form1" method="post" runat="server">
    <table cellspacing="0" cellpadding="0" width="100%" border="0">
        <tr>
            <td>
                <div class="div_subtitle">
                    当前位置：客户案例管理<span class="arrow_subtitle">&gt;</span>客户案例列表</div>
            </td>
        </tr>
    </table>
    <table id="tb_content" cellspacing="0" cellpadding="0" align="center">
        <tbody>
            <tr>
                <td>
                    <table class="tb_searchbar" cellspacing="1" width="100%">
                        <tbody>
                            <tr>
                                <td class="td_head" colspan="4">
                                    <img class="icon" height="13" src="../../img/search1.gif" width="13">
                                    请填写查询条件
                                </td>
                            </tr>
                            <tr>
                                <td class="td_title" nowrap width="15%">
                                    客户案例标题
                                </td>
                                <td class="detail">
                                    <asp:TextBox ID="txtNewsTitle" runat="server"></asp:TextBox>
                                </td>
                                <td class="td_title" nowrap width="15%">
                                    发布时间
                                </td>
                                <td class="td_detail">
                                    <cc2:DateTextBox ID="txtBeginDate" runat="server"  imgpath="../../img/calendar.gif"
                                        width="120px" onpickclientid="txtEndDate"></cc2:DateTextBox>
                                    至
                                    <cc2:DateTextBox ID="txtEndDate" runat="server"  imgpath="../../img/calendar.gif"
                                        width="120px"></cc2:DateTextBox>                                    
                                </td>
                            </tr>
                            <tr>
                                <td class="td_title" nowrap width="15%">
                                    类型
                                </td>
                                <td class="detail">
                                    <asp:DropDownList Width="120" ID="drList" runat="server">
                                    </asp:DropDownList>
                                </td>
                                <td class="td_title" nowrap width="15%">
                                    &nbsp;
                                </td>
                                <td class="td_detail">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td align="right" colspan="4">
                                    <asp:Button ID="btnSearch" runat="server" Text="查询" CssClass="Button" OnClick="btnSearch_Click">
                                    </asp:Button><font face="宋体">&nbsp;</font>
                                    <asp:Button ID="btnAdd" runat="server" Text="新增" CssClass="Button" 
                                        onclick="btnAdd_Click"></asp:Button><font
                                        face="宋体">&nbsp;</font>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <cc1:ZteGrid ID="dgNews" runat="server" CssClass="tb_datalist" PageChange="TextBox"
                        Width="100%" AllowPaging="True" PageLanguage="Chinese" 
                        IsAllowPaging="True" BorderWidth="0px"
                        CellSpacing="1" AutoGenerateColumns="False" CacheData="ServerCach" SortMode="Total"
                        PageCSS="scrollButton" BorderStyle="Solid" 
                        onitemcommand="dgNews_ItemCommand" onitemdatabound="dgNews_ItemDataBound">
                        <AlternatingItemStyle CssClass="tr_even" BackColor="#F7F9FE"></AlternatingItemStyle>
                        <FooterStyle BackColor="#E8E8E8"></FooterStyle>
                        <ItemStyle BorderColor="White" BackColor="White"></ItemStyle>
                        <Columns>
                            <asp:BoundColumn Visible="False" DataField="seqno" HeaderText="seqno"></asp:BoundColumn>
                            <asp:TemplateColumn>
                                <HeaderStyle Width="30px" />
                                <HeaderTemplate>
                                    <asp:CheckBox ID="cbxAll" runat="server" ToolTip="全选/全否选" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="cbItem" runat="server" /><asp:HiddenField ID="txtSeqno" Value='<%# DataBinder.Eval(Container.DataItem, "seqno") %>'
                                        runat="server" />
                                </ItemTemplate>
                            </asp:TemplateColumn>
                            <asp:BoundColumn DataField="Title" HeaderText="客户案例标题"></asp:BoundColumn>
                            <asp:BoundColumn DataField="Type" HeaderText="客户案例类型"></asp:BoundColumn> 
                            <asp:BoundColumn DataField="CreateDate" HeaderText="发布时间"></asp:BoundColumn>
                            <asp:BoundColumn DataField="ShowIdx" HeaderText="显示顺序"></asp:BoundColumn>
                            <asp:TemplateColumn>
                                <HeaderTemplate>
                                    是否首页
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:LinkButton ID="linkF" runat="server" CommandName="F"><%#ChangeCn(DataBinder.Eval(Container.DataItem, "IsFist"))%></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateColumn>                            
                            
                            <asp:TemplateColumn>
                                <HeaderTemplate>
                                    操作
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:LinkButton ID="btnModify" runat="server" CommandName="Modify">修改</asp:LinkButton>
                                    <font face="宋体">&nbsp;</font>
                                    <asp:LinkButton ID="btnDelete" runat="server" CommandName="Delete">删除</asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateColumn>
                        </Columns>
                        <HeaderStyle CssClass="tr_title" BackColor="LightGray"></HeaderStyle>
                        <SelectedItemStyle CssClass="tr_selected" BackColor="#D8D8D8"></SelectedItemStyle>
                        <PagerStyle CssClass="tr_pagenumber"></PagerStyle>
                    </cc1:ZteGrid>                    
                </td>
            </tr>
        </tbody>
    </table>
    <table width="100%" style="margin-top: 5px">
        <tr>
            <td>                 
                <asp:Button ID="btnDel" runat="server" CssClass="button" Text="删除" OnClick="btnDel_Click"
                    OnClientClick="return CheckSelected('dgNews',1);" />
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
